<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.dati.bean.*,com.dati.dao.*,com.dianbo.bean.*,com.dianbo.dao.*" %>
<%
	String orderType = request.getParameter("orderType");
	String formName= request.getParameter("formName");
	List<DianboType> lastDianboTypeList = (ArrayList<DianboType>)session.getAttribute("lastDianboTypeList");
	List<DatiType> lastDatiTypeList = (ArrayList<DatiType>)session.getAttribute("lastDatiTypeList");
%>
<jsp:include page="../head.jsp"></jsp:include>


<body>
 
                <ul class="tabs-nav clearfix">
                    <li>新增指令</li>
                </ul>
                <div class="tabs-panel">
                 <form action="">
                	<table width="100%" class="datalist" border="1">
                	      <%
                	       if(orderType.equals("0")){//点播
                	    	   %>
                	    	   <tr>
                	    	   <td>类型:</td>
                                <td>
                                 <select id="db" name="db" onchange="selectOrder(db.value)">
                                   <option value="0">请选择</option>
                                  <%
                                   if(lastDianboTypeList!=null&&lastDianboTypeList.size()>0){
                                	   for(DianboType dianbo:lastDianboTypeList){
                                		   %>
                                		   <option value="<%=dianbo.getTypeId() %>"><%=dianbo.getTypeName() %></option>
                                		   <%
                                	   }
                                   }
                                  %>
                                 </select>
                                </td>
                                </tr>
                	    	   <%
                	       }else if(orderType.equals("1")){//答题
								%>
								<tr>
								<td>类型:</td>
                                <td>
                                 <select id="dt" name="dt" onchange="selectOrder(dt.value)">
                                   <option value="0">请选择</option>
                                  <%
                                   if(lastDatiTypeList!=null&&lastDatiTypeList.size()>0){
                                	   for(DatiType dati:lastDatiTypeList){
                                		   %>
                                		   <option value="<%=dati.getAnswerTypeId() %>"><%=dati.getTypeName() %></option>
                                		   <%
                                	   }
                                   }
                                  %>
                                 </select>
                                </td>
                                </tr>
								<%                 	    	   
                	       }
                	      %>
                              
                                <tr>
                                <td class="t1">名称:</td><td><input type="text" name="orderName" id="orderName" value=""/>
                                <input type="hidden" name="orderType" id="orderType" value="<%=orderType %>"/>
                                <input type="hidden" name="typeId" id="typeId" value="0"/></td>
                              </tr>
                              <tr><td class="tc"><input type="button" value="确定" onclick="addOrder('../TbOrderServlet?method=addOrderSubmit');"/></td>
                              <td class="tc"><input type="button" value="关闭" onclick="<%=formName %>.mb.close();"/>
                              </td>
                              </tr>
                    </table>
                   </form>
                </div>                
        </body>
</html>
